package com.itheima.zixi3.ZuoYe1;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class ZuoYe1 {
    public static void main(String[] args) {
        String[] name= {"JavaEE企业级开发指南", "Oricle高级编程", "MySQL从入门到精通", "Java架构师之路"
        };
        Collection <String> c = new ArrayList<>();
        for (int i = 0; i < name.length; i++) {
            c.add(name[i]);
        }
        findall(name, c);
        dayu10(name, c);
        findjava(c);
        remove(c);
    }

    private static void remove(Collection<String> c) {
        Iterator <String> i = c.iterator();
        while(i.hasNext()){
            String s = i.next();
            if(s.contains("Oricle")){
               i.remove();
            }
        }
        System.out.println(c);
    }

    private static void findjava(Collection<String> c) {
        Iterator <String> i = c.iterator();
        while(i.hasNext()){
            String s = i.next();
            if(s.contains("Java")){
                System.out.println(s);
            }
        }
    }

    private static void dayu10(String[] name, Collection<String> c) {
        Iterator <String> i = c.iterator();

        while(i.hasNext()){
            String s = i.next();
            System.out.println(s.length());
            if(s.length() >= 10){
                System.out.println(s);
            }
        }
    }

    private static void findall(String[] name, Collection<String> c) {
        Iterator <String> i = c.iterator();
        while(i.hasNext()){
            System.out.println(i.next());
        }
    }
}

